<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(function(){
		$("tr:odd").css("background-color","red");
	});
    $(".a").on("click",(function(){
       if(window.confirm("你确定删除吗"))
       $(this).parent()..parent().remove();
	   location.href='DetailMessageServlet';
	})

</script>
</head>
<body>
    <table border="1" cellspacing="0" cellpadding="0" width="1200" align="center">
         <tr>
              <td><a href="DeleteServlet" class="a">删除</a></td>
              <td>车次</td>
              <td>发车--到达</td> 
              <td>发时--到时</td>
              <td>车型</td>
              <td>运行时间(小时)</td>
         </tr>
         <c:if test="${empty list}">
            <c:redirect url="ShowMessageServlet.jsp"></c:redirect>
         </c:if>
         <c:if test="${not empty list}">
              <c:forEach items="${list}" var="t">
               <tr>
              <td><input type="checkbox" name="check"></td>
              <td><a href="DetailMessageServlet?no=${t.train_no}">${t.train_no}</a></td>
              <td>${t.start_station}—${t.arrival_station}</td>
              <td>${t.start_time}—${t.arrival_time}</td>
              <td>${t.type}</td>
              <td>${t.runtime}</td>
              </tr>
              </c:forEach>
         </c:if>
    </table>
</body>
</html>